# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=zopfli
pkgver=1.0.3
pkgrel=0
pkgdesc="Compression algorithm library"
url="https://github.com/google/zopfli"
arch="all"
license="Apache-2.0"
makedepends="cmake"
options="!check" # no test suite?
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/google/zopfli/archive/zopfli-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None .
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/
	install -m644 README* \
		"$pkgdir"/usr/share/doc/$pkgname/
}

sha512sums="362cbeee0b3f04a4c5da512f82671491f874d4ec7b693dca9724ae42123d7ac184cc4d5de1872b4f1fc938c97f79dfdb482f62d1fca4a17cff6d267f6021e8d2  zopfli-1.0.3.tar.gz"
